package com.qd.core.config;

import com.baomidou.mybatisplus.core.toolkit.AES;
import lombok.extern.slf4j.Slf4j;

/**
 * mybatis-plus 加密数据库配置参数
 *
 * @author sjk
 */
@Slf4j
public class MyBatisPlusEncryption {

//    static String randomKey = AES.generateRandomKey();

    public static void main(String[] args) {
        String data = "jdbc:p6spy:mysql://mysql.publicservice.svc.cluster.local/base_platform?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&useSSL=false&zeroDateTimeBehavior=convertToNull&serverTimezone=Asia/Shanghai&rewriteBatchedStatements=true";
//       String data="123456";
        // 生成 16 位随机 AES 密钥
//        System.out.println("randomKey: " + randomKey);
        // 随机密钥加密
        String randomKey = "86ac38b98dfc561e";
        String result = AES.encrypt(data, randomKey);
        log.info(result);
    }
}